package a.j;

import a.c.d;
import a.c.e;
import a.c.m;
import a.c.w;

import javax.swing.*;
import javax.swing.event.PopupMenuEvent;
import javax.swing.event.PopupMenuListener;
import java.awt.event.MouseEvent;

public abstract class dg
  extends gf
{
  private boolean m = true;
  private boolean G;
  private Runnable H;
  private boolean I = true;
  public static final int J = 0;
  public static final int K = 1;
  public static final int L = 2;
  public static final int M = 3;
  public static final int N = 4;
  public static final int O = 5;
  public static final int P = 6;
  public static final int Q = 7;
  public static final int R = 8;
  public static int S;
  
  public dg() {}
  
  public dg(df paramdf)
  {
    super(paramdf);
  }
  
  public void mousePressed(MouseEvent paramMouseEvent)
  {
    this.G = true;
    if (!ld.E)
    {
      if ((paramMouseEvent.isPopupTrigger()) || (SwingUtilities.isRightMouseButton(paramMouseEvent))) {
        this.s = paramMouseEvent;
      }
    }
    else {
      b(a(paramMouseEvent.getX()), b(paramMouseEvent.getY()));
    }
  }
  
  public void g()
  {
    super.g();
  }
  
  public void mouseReleased(MouseEvent paramMouseEvent)
  {
    this.G = false;
    if ((ld.E) || (this.H != null)) {
      g();
    }
  }
  
  protected int a(sc paramsc, double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    if (!bool) {
      if (b(paramsc, paramDouble1, paramDouble2)) {
        return 0;
      }
    }
    if (!bool) {
      if (d(paramsc, paramDouble1, paramDouble2)) {
        return 1;
      }
    }
    if (!bool) {
      if (h(paramsc, paramDouble1, paramDouble2)) {
        return 2;
      }
    }
    if (!bool) {
      if (c(paramsc, paramDouble1, paramDouble2)) {
        return 3;
      }
    }
    if (!bool) {
      if (e(paramsc, paramDouble1, paramDouble2)) {
        return 8;
      }
    }
    if (!bool) {
      if (g(paramsc, paramDouble1, paramDouble2)) {
        return 4;
      }
    }
    if (!bool) {
      if (i(paramsc, paramDouble1, paramDouble2)) {
        return 5;
      }
    }
    if (!bool) {
      if (j(paramsc, paramDouble1, paramDouble2)) {
        return 6;
      }
    }
    return 7;
  }
  
  protected void a(sc paramsc, double paramDouble1, double paramDouble2, int paramInt)
  {
    g localg = k();
    if (!ld.E) {}
    switch (paramInt)
    {
    case 0: 
      b(localg);
      a(localg, paramsc.m(), true);
      return;
    case 1: 
      b(localg);
      a(localg, paramsc.n(), true);
      return;
    case 2: 
      b(localg);
      a(localg, paramsc.q(), true);
      return;
    case 3: 
      b(localg);
      a(localg, paramsc.o(), true);
      return;
    case 4: 
      b(localg);
      a(localg, paramsc.p(), true);
      return;
    case 5: 
      b(localg);
      return;
    case 6: 
    case 8: 
      b(localg);
      a(localg, paramsc.s(), true);
      return;
    }
  }
  
  protected boolean a(g paramg)
  {
    return paramg.P();
  }
  
  protected void b(g paramg)
  {
    paramg.V();
  }
  
  protected void a(g paramg, jd paramjd, boolean paramBoolean)
  {
    paramjd.a(paramBoolean);
  }
  
  protected void a(g paramg, e parame, boolean paramBoolean)
  {
    paramg.a(parame, paramBoolean);
  }
  
  protected void a(g paramg, hg paramhg, boolean paramBoolean)
  {
    paramg.a(paramhg, paramBoolean);
  }
  
  protected void a(g paramg, d paramd, boolean paramBoolean)
  {
    paramg.a(paramd, paramBoolean);
  }
  
  protected void a(g paramg, eb parameb, boolean paramBoolean)
  {
    parameb.a(paramBoolean);
  }
  
  protected void b(double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    g localg = k();
    PopupMenuListener local1 = new PopupMenuListener()
    {
      public void popupMenuCanceled(PopupMenuEvent paramAnonymousPopupMenuEvent) {}
      
      public void popupMenuWillBecomeVisible(PopupMenuEvent paramAnonymousPopupMenuEvent)
      {
        dg.this.H = null;
      }
      
      public void popupMenuWillBecomeInvisible(PopupMenuEvent paramAnonymousPopupMenuEvent)
      {
        ((JPopupMenu)paramAnonymousPopupMenuEvent.getSource()).removePopupMenuListener(this);
        dg.this.H = new dg.0(this);
        SwingUtilities.invokeLater(dg.this.H);
      }
    };
    sc localsc = a(paramDouble1, paramDouble2);
    int i = a(localsc, paramDouble1, paramDouble2);
    JPopupMenu localJPopupMenu = getPopup(localsc, paramDouble1, paramDouble2, i);
    if (!bool)
    {
      if (localJPopupMenu != null)
      {
        if (bool) {
          break label105;
        }
        if (localJPopupMenu.getComponentCount() != 0) {}
      }
      else
      {
        g();
      }
    }
    else
    {
      if (bool) {
        break label105;
      }
      if (!ld.D) {
        return;
      }
    }
    localJPopupMenu.addPopupMenuListener(local1);
    if (!bool)
    {
      if (this.m) {
        label105:
        a(localsc, paramDouble1, paramDouble2, i);
      }
      localg.gb();
    }
    a(localJPopupMenu, paramDouble1, paramDouble2);
  }
  
  protected JPopupMenu getPopup(sc paramsc, double paramDouble1, double paramDouble2, int paramInt)
  {
    switch (paramInt)
    {
    case 0: 
      return getNodePopup(paramsc.m());
    case 1: 
      return getBendPopup(paramsc.n());
    case 2: 
      return getEdgeLabelPopup(paramsc.q());
    case 3: 
      return getEdgePopup(paramsc.o());
    case 8: 
      return getNodePortPopup(paramsc.s());
    case 4: 
      return getNodeLabelPopup(paramsc.p());
    case 5: 
      return getPaperPopup(paramDouble1, paramDouble2);
    case 6: 
      return getSelectionPopup(paramDouble1, paramDouble2);
    }
    return null;
  }
  
  protected void a(JPopupMenu paramJPopupMenu, double paramDouble1, double paramDouble2)
  {
    this.i.a(paramJPopupMenu, paramDouble1, paramDouble2);
  }
  
  public JPopupMenu getNodePopup(e parame)
  {
    return new JPopupMenu();
  }
  
  public JPopupMenu getBendPopup(eb parameb)
  {
    return new JPopupMenu();
  }
  
  public JPopupMenu getEdgePopup(d paramd)
  {
    return new JPopupMenu();
  }
  
  public JPopupMenu getPaperPopup(double paramDouble1, double paramDouble2)
  {
    return new JPopupMenu();
  }
  
  public JPopupMenu getSelectionPopup(double paramDouble1, double paramDouble2)
  {
    return new JPopupMenu();
  }
  
  public JPopupMenu getEdgeLabelPopup(ig paramig)
  {
    return new JPopupMenu();
  }
  
  public JPopupMenu getNodePortPopup(jd paramjd)
  {
    return new JPopupMenu();
  }
  
  public JPopupMenu getNodeLabelPopup(jg paramjg)
  {
    return new JPopupMenu();
  }
  
  public void g(boolean paramBoolean)
  {
    this.m = paramBoolean;
  }
  
  public boolean v()
  {
    return this.m;
  }
  
  private boolean b(sc paramsc, double paramDouble1, double paramDouble2)
  {
    boolean bool = ld.E;
    w localw = k().R();
    e locale = paramsc.m();
    if (w())
    {
      if (locale != null) {
        if (bool) {}
      }
      return localw.k() <= 1;
    }
    if (locale != null) {
      if (bool) {}
    }
    return localw.k() == 0;
  }
  
  private boolean c(sc paramsc, double paramDouble1, double paramDouble2)
  {
    m localm = k().S();
    d locald = paramsc.o();
    if (locald != null) {
      if (ld.E) {}
    }
    return localm.k() <= 1;
  }
  
  private boolean d(sc paramsc, double paramDouble1, double paramDouble2)
  {
    return paramsc.n() != null;
  }
  
  private boolean e(sc paramsc, double paramDouble1, double paramDouble2)
  {
    return paramsc.s() != null;
  }
  
  private boolean g(sc paramsc, double paramDouble1, double paramDouble2)
  {
    return paramsc.p() != null;
  }
  
  private boolean h(sc paramsc, double paramDouble1, double paramDouble2)
  {
    return paramsc.q() != null;
  }
  
  private boolean i(sc paramsc, double paramDouble1, double paramDouble2)
  {
    g localg = k();
    return a(localg);
  }
  
  private boolean j(sc paramsc, double paramDouble1, double paramDouble2)
  {
    g localg = k();
    if (!ld.E) {}
    return !a(localg);
  }
  
  public void h(boolean paramBoolean)
  {
    this.I = paramBoolean;
  }
  
  public boolean w()
  {
    return this.I;
  }
}



/* Location:           E:\idea\

 * Qualified Name:     a.j.dg

 * JD-Core Version:    0.7.0.1

 */